﻿/* Write a program that compares two char arrays lexicographically (letter by letter).
*/
using System;
using System.Collections.Generic;

class CompareArrStrings
{
    static void Main()
    {
        //read two strings
        string s1, s2;
        
        Console.Write("Enter string 1: ");
        s1 = Console.ReadLine();
        
        Console.Write("Enter string 2: ");
        s2 = Console.ReadLine();

        //convert our strings to char arrays
            char[] sc1 = new char[s1.Length];
            sc1 = s1.ToCharArray();

            char[] sc2 = new char[s2.Length];
            sc2 = s2.ToCharArray();
        
        //compare
        bool equal = true;
        for (int i = 0; i < sc1.Length; i++)
        {
            if (sc1[i] != sc2[i])
            {
                equal = false;
                break;
            }
        }

        if (equal) Console.WriteLine("Strings are equal.");
        else Console.WriteLine("Strings are not equal.");

    }
}
